import ij.ImagePlus;
import ij.plugin.filter.PlugInFilter;
import ij.process.ImageProcessor;


public class MyPrivateFirstPlugin implements PlugInFilter {

	public void run(ImageProcessor ip) {
		int M = ip.getWidth();
		int N = ip.getHeight();
		
		for (int u = 0; u < M; u++) {
			for (int v = 0; v < N; v++) {
				int p = ip.getPixel(u,v);
				ip.putPixel(u,v,255-p);
			}
		}
	}

	public int setup(String arg0, ImagePlus im) {
		return DOES_8G;
	}

}
